select *
from TicketReturn

----create procedure----------------

create procedure viTicketReturn
as
begin
select * from TicketReturn
end
go

exec viTicketReturn

go

-----------AddTicketReturn-------------------------
Create procedure AddTicketReturn

@TicketName nvarchar(50),
@Description nvarchar(50),
@PercentPrice  int,
@DateReturn int
as
begin 
insert into TicketReturn( TicketName,[Description], PercentPrice, DateReturn) values(@TicketName, @Description, @PercentPrice, @DateReturn) 
end
go
exec AddTicketReturn 'than 10', 'more than 2 day',30,1

exec viTicketReturn
go
-------------UpdateTicketReturn----------------------------------------
Create procedure UpdateTicketReturn
@TicketReturnID int,
@TicketName nvarchar(50),
@Description nvarchar(50),
@PercentPrice  int,
@DateReturn int
as
begin 
update TicketReturn set TicketName=@TicketName,[Description]=@Description,PercentPrice=@PercentPrice,DateReturn=@DateReturn where TicketReturnID=@TicketReturnID
end
go

exec UpdateTicketReturn 11 ,'hue','comeback',11,1

exec viTicketReturn
go


-----------------DeleteTicketReturn--------------------------------------
Create procedure DeleteTicketReturn
@TicketReturnID int
as
begin
delete from TicketReturn where TicketReturnID=@TicketReturnID
end
go

exec DeleteTicketReturn 10
go
exec viTicketReturn
go
------------------------------------------------------------

-----------Create ProcedurePromote--------------------------
create procedure viPromote
as
begin
select * from Promote
end
go

exec viPromote

go

-----------AddPromote------------------------------------------------
Create procedure AddPromote

@PromoteName nvarchar(50),
@Discount int
as
begin 
insert into Promote( PromoteName,Discount) values(@PromoteName,@Discount) 
end
go
exec AddPromote 'sixty to eighty', 50

exec viPromote
go

-------------UpdatePromote----------------------------------------
Create procedure UpdatePromote
@PromoteID int,
@PromoteName nvarchar(50),
@Discount int
as
begin 
update Promote set PromoteName=@PromoteName,Discount=@Discount where PromoteID=@PromoteID
end
go

exec UpdatePromote

exec viPromote
go


-----------------DeletePromote--------------------------------------
Create procedure DeletePromote
@PromoteID int
as
begin
delete from Promote where PromoteID=@PromoteID
end
go

exec DeletePromote 9
go
exec viPromote
go
------------------------------------------------------------